<%@ page import="Action.Sys.Setting" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%--
  Created by IntelliJ IDEA.
  User: 高金磊
  Date: 2021/4/21
  Time: 17:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <link rel="icon" href="<%=basePath%>favicon.ico" type="image/ico">
    <link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">
    <link href="<%=basePath%>css/fonts.css" rel="stylesheet">
    <link href="<%=basePath%>css/style.css" rel="stylesheet">
</head>
<body>
<s:action name="find_order">
    <%--<table>--%>
        <%--<thead>--%>
        <%--<tr>--%>
            <%--<th>orderId</th>--%>
            <%--<th>图书Id</th>--%>
            <%--<th>用户Id</th>--%>
            <%--<th>图书名称</th>--%>
            <%--<th>用户名称</th>--%>
            <%--<th>订单发起时间</th>--%>
            <%--<th>租借天数</th>--%>
            <%--<th>剩余天数</th>--%>
            <%--<th>订单状态</th>--%>
            <%--<th>操作</th>--%>
        <%--</tr>--%>
        <%--</thead>--%>
        <%--<form method="get">--%>
            <%--<input value="<%=request.getParameter("key")==null?"":request.getParameter("key")%>" name="key">--%>
            <%--<input type="submit" value="查找" formaction="find_order"/>--%>
            <%--<input type="submit" name="state" value="All" formaction="filter_order">--%>
            <%--<input type="submit" name="state" value="预约" formaction="filter_order">--%>
            <%--<input type="submit" name="state" value="待还书" formaction="filter_order">--%>
            <%--<input type="submit" name="state" value="订单完成" formaction="filter_order">--%>
        <%--</form>--%>
        <%--<s:iterator value="#request.data" var="data">--%>
            <%--<tbody>--%>
            <%--<tr>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].id"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].userId"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].bookId"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[2].book_name"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[1].username"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].loanTime"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].day"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].remainingDays()"/>--%>
                <%--</td>--%>
                <%--<td>--%>
                    <%--<s:property value="#data[0].state"/>--%>
                <%--</td>--%>

                <%--<td>--%>
                    <%--<form action="AltOrder.action" method="get">--%>
                        <%--<input type="hidden" name="modify_key" value="<s:property value="#data[0].id"/>"/>--%>
                        <%--<input type="submit"  value="详情">--%>
                    <%--</form>--%>
                <%--</td>--%>
            <%--</tr>--%>
            <%--</tbody>--%>
        <%--</s:iterator>--%>

    <%--</table>--%>






<div class="row">

    <div class="col-lg-12">
        <div class="card-toolbar clearfix">

            <form class="pull-left search-bar" method="get" action="<%=basePath%>find_order.action" role="form">

                <div style="width: 500px" class="input-group">


                    <input name="key" type="text" class="form-control" value="<%=request.getParameter("key")==null?"":request.getParameter("key")%>"  placeholder="输入订单编号/用户id(支持模糊搜索)">
                    <div>
                            <%--<button type="submit" value="<%=request.getParameter("key")==null?"":request.getParameter("key")%>" name="key">--%>
                        <button class="button btn-link"  type="submit" name="state" value="All" >全部</button>
                        <button class="button btn-link"  type="submit" name="state" value="预约">预约</button>
                        <button class="button btn-link"  type="submit" name="state" value="<%=Setting.LoanBook_state_need_Return%>" >待还</button>
                        <button class="button btn-link"  type="submit" name="state" value="<%=Setting.LoanBook_state_closed%>">已完成</button>
                    </div>

                    <span style="color:red"><s:actionerror/></span>
                </div>
            </form>
                <%--<div class="toolbar-btn-action">--%>
                <%--<a class="btn btn-primary m-r-5 submenuitem" href="pages_data.html" data-id="link552" data-index="552"> 新增</a>--%>
                <%--<a class="btn btn-success m-r-5 submenuitem" href="pages_data.html" data-id="link553" data-index="553"> 启用</a>--%>
                <%--<a class="btn btn-warning m-r-5 submenuitem" href="pages_data.html" data-id="link554" data-index="554"> 禁用</a>--%>
                <%--<a class="btn btn-danger submenuitem" href="pages_data.html" data-id="link555" data-index="555"> 删除</a>--%>
                <%--</div>--%>
        </div>
        <div class="card">
            <div class="card-body">
                <div class="table-responsive">
                    <h4>订单列表(<s:property value="#request.data.size()"/>条)</h4>

                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>订单号</th>
                            <th>用户名</th>
                            <th>图书名称</th>
                            <th>下单日期</th>
                            <th>借阅天数</th>
                            <th>剩余天数</th>
                            <th>状态</th>
                            <th>订单进度</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <s:iterator value="#request.data" var="data">


                            <tr>
                                <td><s:property value="#data[0]"/> </td>
                                <td><a class="submenuitem" href="AltUserInfo.action?modify_id=<s:property value="#data[8]"/>" data-id="link552" data-index="552"><s:property value="#data[1]"/> </a></td>
                                <td><a class="submenuitem" href="AltBookInfo.action?modify_id=<s:property value="#data[9]"/>" data-id="link552" data-index="552"><s:property value="#data[2]"/> </a></td>
                                <td><s:property value="#data[3]"/> </td>
                                <td><s:property value="#data[4]"/> </td>
                                <td><s:property value="#data[5]"/> </td>
                                <td><span class="label label-info"><s:property value="#data[6]"/> </span></td>
                                <td>
                                    <div class="progress progress-striped progress-sm">
                                        <div class="progress-bar progress-bar-success" style="width: <s:property value="#data[7]"/>%;"></div>
                                    </div>
                                </td>
                                <td>
                                    <a class="ftsucai-jshezhi" href="<%=basePath%>AltOrder.action?modify_key=<s:property value="#data[0]"/>">
                                    </a>

                                </td>
                            </tr>
                        </s:iterator>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

</div>

</s:action>
<br>
<br>
<br>
<br>
<br>

<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/bootstrap.js"></script>
<script type="text/javascript" src="<%=basePath%>js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/main.min.js"></script>
<script type="text/javascript">
    $(function(){
        $('.search-bar .dropdown-menu a').click(function() {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>
